#include<wx/wx.h>
#include "solver.h"

int main()
{
    int size=8;
    Solver *s = new Solver(size);
    int a,b,c,d;
    int movetype;

    while(!isGameEnd){
        system("cls");
        s->debugBoard(size);
        //cout<<"enter your move :";
        //cin>>a>>b>>c>>d;
        //s->moveCell(a,b,c,d);
        bool ok=true;
        bool gerak=true;
        while(ok){
            s->moveByGreedyTypeOne(ID_PLAYER_HITAM,size,&ok,&movetype,&gerak);
            //cout<<ok<<endl;
        }
        if(gerak)
            cout<<"moved "<<s->getSource().x<<","<<s->getSource().y<<" to "<<s->getDest().x<<","<<s->getDest().y<<endl;
        //if(!gerak){
            //system("cls");
            //s->debugBoard();
            //cout<<"putih kalah"<<endl;
            //return 0;
        //}
        //for(int i=0;i<10000000;++i)
        //for(int j=0;j<60;++j) 5==3;
        ok=true;
        while(ok){
            s->moveByGreedyTypeTwo(ID_PLAYER_PUTIH,size,&ok,&movetype,&gerak);
        }
        if(gerak)
            cout<<"moved "<<s->getSource().x<<","<<s->getSource().y<<" to "<<s->getDest().x<<","<<s->getDest().y<<endl;
        //if(!gerak){
          //  system("cls");
            //s->debugBoard();
            //cout<<"putih kalah"<<endl;
            //return 0;
        //}
        isGameEnd=s->updateGameStatus(size);
        //for(int i=0;i<10000000;++i)
        //for(int j=0;j<60;++j) 5==3;
    }
    system("cls");
    s->debugBoard(size);
    return 0;
}
